using System;
using MonoTouch.Dialog;

namespace Socialite
{
	// TODO: 	A. Come back to see if we should consolidate this class with BasicSignupInfo 
	//    		B. Check if password is the same as confirmed password
	public class BasicProfileInfo
	{
		[Section ("Basic Info")]
		
		[Caption ("First Name")]
		public string FirstName{ get; set;}
		
		[Caption ("Last Name")]
		public string LastName{ get; set;}

		[Caption ("Email")]
		public string Email{ get; set;}

 		[Caption ("Change Password")]
		[Password ("")]
		public string Password{ get; set;}
		
		[Caption ("Confirm Password")]
		[Password ("")]
		public string ConfirmedPassword{ get; set;}
		
		[Entry]
		public Sex Gender{ get; set;} 		
		
		[Entry]
		public Ethnicity Race{ get; set;}
		
		[Date]
		public DateTime Birthday {
			get {
				return _birthday;
			}
			
			set {
				_birthday = value;
				Age = _birthday.Year - System.DateTime.Today.Year;
			}
		}
		private DateTime _birthday;
		
		public int Age {get; set;}

		public BasicProfileInfo()
		{	
			// Retreive data from DB
			FirstName = "Adam";
			LastName = "Kiu";
			Email = "adam.kiu@gmail.com";
			Birthday = new DateTime(1986, 06, 02);
			Gender = Sex.Male;
			Race = Ethnicity.Asian;

			// Do not display password or it's length
			Password = ConfirmedPassword = String.Empty;
		}
	}
}
